package ForTest;

public class Student {
    private String name;
    private String id;
    private int classNum;
    // 负数代表保密，0代表男性，1代表女性，其他数值代表未知
    private int gender;
    // 0-110，不存在负数，大于110时信息概要中会提示“此年龄存疑”
    private int age;
    private String character;

    public Student(String name, String id, int classNum, int gender, int age, String character){
        this.name = name;
        this.id = id;
        this.classNum = classNum;
        this.gender = gender;
        this.age = age;
        if (this.age < 0){
            this.age = 0;
        }
        this.character = character;
    }

    String get_name(){
        return this.name;
    }
	String get_id(){
        return this.id;
    }
	int get_class(){
        return this.classNum;
    }
	int get_gender(){
        return this.gender;
    }
	int get_age(){
        return this.age;
    }
    String get_character(){
        return this.character;
    }

    void cout_info(){
        System.out.print("=-------------学生信息-------------=\n");
        System.out.print("姓名：");
        System.out.println(name);
        System.out.print("学号：");
        System.out.println(id);
        System.out.print("学号：");
        System.out.print(classNum);
        System.out.print("班");
        if (classNum < 1) System.out.print("（此班级有误）");
        System.out.print("\n");
        if (gender < 0) {
            System.out.println("性别：保密");
        }
        else if (gender == 0) {
            System.out.println("性别：男性");
        }
        else if (gender == 1) {
            System.out.println("性别：女性");
        }
        else {
            System.out.println("性别：未知");
        }
        System.out.print("年龄：");
        System.out.print(age);
        if (age > 110) System.out.print("（此年龄存疑）");
        System.out.print("\n");
        System.out.print("性格：" + character + "\n");
        System.out.println("=----------------------------------=");
    }
}
